/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface UnitBuilding extends BasicModel<UnitBuilding> {
  enterpriseId?: number; // 企业id
  enterpriseName?: string; // 企业名称
  name?: string; // 建筑名称
  location?: string; // 省市县外详细地址
  fireEngineNum?: number; // 消防引擎数量
  equipmentNum?: number; // 设备数量
  occupyArea?: number; // 占地面积
  buildingType?: string; // 建筑类型 11001-11006 民用建筑，工业建筑，仓库，储罐，堆场，装置
  unitAbutSituation?: string; // 毗邻建筑物信息
  addTime?: string; // 添加时间
  updateTime?: string; // 更新时间
  deleted?: string; // 逻辑删除
  unitCode?: string; // 单位代码
}

export const unitBuildingList = (params?: UnitBuilding | any) =>
  defHttp.get<UnitBuilding>({ url: adminPath + '/unitmanage/unitBuilding/list', params });

export const unitBuildingListData = (params?: UnitBuilding | any) =>
  defHttp.post<Page<UnitBuilding>>({ url: adminPath + '/unitmanage/unitBuilding/listData', params });

export const unitBuildingForm = (params?: UnitBuilding | any) =>
  defHttp.get<UnitBuilding>({ url: adminPath + '/unitmanage/unitBuilding/form', params });

export const unitBuildingSave = (params?: any, data?: UnitBuilding | any) =>
  defHttp.postJson<UnitBuilding>({ url: adminPath + '/unitmanage/unitBuilding/save', params, data });

export const unitBuildingDelete = (params?: UnitBuilding | any) =>
  defHttp.get<UnitBuilding>({ url: adminPath + '/unitmanage/unitBuilding/delete', params });
